package cn.myjerry.net.ip;

import java.net.InetAddress;
import java.net.InetSocketAddress;

/**
 * 封装端口：在InetAddress的基础上 + 端口
 * @author Jerry
 *
 */
public class InetSockeDemo01 {
	public static void main(String[] args) {
		InetSocketAddress address = new InetSocketAddress("127.0.0.1", 8099);
		
		System.out.println(address.getHostName());
		System.out.println(address.getPort());
		
		InetAddress addr = address.getAddress();
		
		System.out.println(addr.getHostAddress());
		System.out.println(addr.getHostName());
		
	}
}
